from bs4 import  BeautifulSoup
import requests
url = 'https://s.weibo.com/top/summary?cate=socialevent'
header = {
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
    'Accept-Encoding': 'gzip, deflate, br',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Cache-Control': 'max-age=0',
    'Connection': 'keep-alive',
    'Cookie': 'SUB=_2A25LSDChDeRhGeFG71sU8SzKyz2IHXVoJMxprDV8PUNbmtAbLU7bkW9NeXTP5EDlA9JpyBTrE0PrfBx7aycy0x5P; SUBP=0033WrSXqPxfM725Ws9jqgMF55529P9D9WhbSpmEwBKzAle4TY4BDVEg5JpX5KzhUgL.FoMRSh.feKzceh22dJLoIp7LxKML1KBLBKnLxKqL1hnLBoMN1hB4SK2ESo5p; ALF=02_1718865395; _s_tentry=-; Apache=1216923806494.9272.1716274331436; SINAGLOBAL=1216923806494.9272.1716274331436; ULV=1716274331446:1:1:1:1216923806494.9272.1716274331436:',
    'Host': 's.weibo.com',
    'sec-ch-ua': '"Chromium";v="21", " Not;A Brand";v="99"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
    'Sec-Fetch-Dest': 'document',
    'Sec-Fetch-Mode': 'navigate',
    'Sec-Fetch-Site': 'none',
    'Sec-Fetch-User': '?1',
    'Upgrade-Insecure-Requests': '1',
    'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36',
}
resp = requests.get(url, headers=header, verify=False)
print(resp.text)

page = BeautifulSoup(resp.text, 'html.parser')

result_list = page.findAll(target="_blank")
print(result_list)

for item in result_list:
    item_name = item.find_next('a').text
    print(item_name)